package com.alax.interfaces.domain;

import java.util.Date;
import com.fasterxml.jackson.annotation.JsonFormat;
import org.apache.commons.lang3.builder.ToStringBuilder;
import org.apache.commons.lang3.builder.ToStringStyle;
import com.alax.common.annotation.Excel;
import com.alax.common.core.domain.BaseEntity;

/**
 * 用户API密钥对象 user_api_key
 * 
 * @author alax
 * @date 2025-04-10
 */
public class UserApiKey extends BaseEntity
{
    private static final long serialVersionUID = 1L;

    /** 密钥ID */
    private Long id;

    /** 用户ID */
    @Excel(name = "用户ID")
    private Long userId;

    /** API密钥 */
    @Excel(name = "API密钥")
    private String apiKey;

    /** API密钥秘钥 */
    @Excel(name = "API密钥秘钥")
    private String apiSecret;

    /** 密钥名称 */
    @Excel(name = "密钥名称")
    private String name;

    /** 状态(0:禁用 1:启用) */
    @Excel(name = "状态(0:禁用 1:启用)")
    private Integer status;

    /** 过期时间 */
    @JsonFormat(pattern = "yyyy-MM-dd")
    @Excel(name = "过期时间", width = 30, dateFormat = "yyyy-MM-dd")
    private Date expireTime;

    /** 每日调用限制 */
    @Excel(name = "每日调用限制")
    private Long dailyLimit;

    /** 每秒请求数限制 */
    @Excel(name = "每秒请求数限制")
    private Long qpsLimit;

    /** IP白名单，多个用逗号分隔 */
    @Excel(name = "IP白名单，多个用逗号分隔")
    private String whiteIps;

    /** 删除标志（0代表存在 1代表删除） */
    private String delFlag;

    public void setId(Long id) 
    {
        this.id = id;
    }

    public Long getId() 
    {
        return id;
    }

    public void setUserId(Long userId) 
    {
        this.userId = userId;
    }

    public Long getUserId() 
    {
        return userId;
    }

    public void setApiKey(String apiKey) 
    {
        this.apiKey = apiKey;
    }

    public String getApiKey() 
    {
        return apiKey;
    }

    public void setApiSecret(String apiSecret) 
    {
        this.apiSecret = apiSecret;
    }

    public String getApiSecret() 
    {
        return apiSecret;
    }

    public void setName(String name) 
    {
        this.name = name;
    }

    public String getName() 
    {
        return name;
    }

    public void setStatus(Integer status) 
    {
        this.status = status;
    }

    public Integer getStatus() 
    {
        return status;
    }

    public void setExpireTime(Date expireTime) 
    {
        this.expireTime = expireTime;
    }

    public Date getExpireTime() 
    {
        return expireTime;
    }

    public void setDailyLimit(Long dailyLimit) 
    {
        this.dailyLimit = dailyLimit;
    }

    public Long getDailyLimit() 
    {
        return dailyLimit;
    }

    public void setQpsLimit(Long qpsLimit) 
    {
        this.qpsLimit = qpsLimit;
    }

    public Long getQpsLimit() 
    {
        return qpsLimit;
    }

    public void setWhiteIps(String whiteIps) 
    {
        this.whiteIps = whiteIps;
    }

    public String getWhiteIps() 
    {
        return whiteIps;
    }

    public void setDelFlag(String delFlag) 
    {
        this.delFlag = delFlag;
    }

    public String getDelFlag() 
    {
        return delFlag;
    }

    @Override
    public String toString() {
        return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE)
            .append("id", getId())
            .append("userId", getUserId())
            .append("apiKey", getApiKey())
            .append("apiSecret", getApiSecret())
            .append("name", getName())
            .append("status", getStatus())
            .append("expireTime", getExpireTime())
            .append("dailyLimit", getDailyLimit())
            .append("qpsLimit", getQpsLimit())
            .append("whiteIps", getWhiteIps())
            .append("delFlag", getDelFlag())
            .append("createBy", getCreateBy())
            .append("createTime", getCreateTime())
            .append("updateBy", getUpdateBy())
            .append("updateTime", getUpdateTime())
            .append("remark", getRemark())
            .toString();
    }
}
